<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	  xmlns:social="http://spring.io/springsocial"
	  xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	  layout:decorator="layout">
	<head>
		<title>Sociowallet</title>
		<link rel="stylesheet" th:href="@{/resources/page.css}" type="text/css" media="screen"></link>
		<link rel="stylesheet" th:href="@{/resources/form.css}" type="text/css" media="screen"></link>
		<link rel="stylesheet" th:href="@{/resources/messages/messages.css}" type="text/css" media="screen"></link>
	</head>
	<body>
		<div id="header">
			<h1><a th:href="@{/}">Sociowallet</a></h1>
		</div>
		
		<div id="leftNav">
			Left nav menu
		</div>
		
		<div id="content" layout:fragment="content">
			<h3>Your Twitter <span th:text="${dmListType}">list type</span> Messages</h3>
			
			<!--  TODO: Bind form -->
			<form th:action="@{/twitter/messages}" method="post">
				<input type="hidden" name="_csrf" th:value="${_csrf.token}" />
				<p>Send a message:</p>
				<label>To: </label><input type="text" name="to"/><br/>
				<textarea name="text" rows="2" cols="80"></textarea><br/>
				<input type="submit" value="Send Message"/>
			</form>
			
			<ul class="choices">
			<li><a th:href="@{/twitter/messages}">Inbox</a></li>
			<li><a th:href="@{/twitter/messages} + '/sent'">Sent</a></li>
			</ul>
			
			
			<div class="feed">
			<ul class="imagedList">
				<li class="imagedItem" th:each="dm : ${directMessages}">
					<div class="image" th:if="${!#strings.isEmpty(dm.sender.profileImageUrl)}">
						<img th:src="${dm.sender.profileImageUrl}" align="left"/>
					</div>
					<div class="content">
					<strong><a th:href="'http://twitter.com/' + ${dm.sender.screenName}" th:text="${dm.sender.screenName}">screen name</a></strong><br/>
					<span class="dmRecipient">to <span th:text="${dm.recipient.screenName}">screen name</span></span><br/>
					<span th:text="${dm.text}">text</span><br/>
					<span class="postTime" th:text="${dm.createdAt}"></span>
					</div>
				</li>
			</ul>
</div>		</div>
	</body>
</html>
